package com.qfedu.buy.server.service.impl;

import com.qfedu.buy.server.entity.Userscore;
import com.qfedu.buy.server.dao.UserscoreDao;
import com.qfedu.buy.server.service.intf.UserscoreService;
import com.qfedu.buy.server.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: NeighborBuy
 * @description: 邻里购真正意义上最懂你的新零售平台
 * @author: Feri(老邢)
 * @create: 2021-01-26 14:22:27
 */
@Service
public class UserscoreServiceImpl implements UserscoreService{
    /*
    *注入持久层对象*/
    @Autowired
    private UserscoreDao dao;
    /*
    * 新增内容*/
    @Override
    public R save(Userscore userscore) {
        if(userscore!=null){
            if(dao.insert(userscore)>0){
                return R.ok();
            }
        }
        return R.fail("新增异常");
    }
    /*
    * 查询 所有数据*/
    @Override
    public R queryAll() {
        return R.ok(dao.selectAll());
    }
}